<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%@ taglib uri="http://www.ccut.edu.cn/saturn" prefix="saturn"%>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>templete jsp</title>
<%@ include file="/extjs/include/all.jsp" %>
<%
	String fullKey = request.getParameter("fullKey");
	String id = request.getParameter("id");
%>
</head>
<body>
<div id="paramInfoDiv" style="width:100%"></div>
<script>
Ext.onReady(function(){
	var store = new Ext.data.JsonStore({
		url:'${pageContext.request.contextPath}/edu.ccut.saturn.manager.bundles.impl::/extComponentModule/action/GetNodeInfoNodeParamByFullKeyAction.action',
		root:'paramInfoList',
		fields:[
			{name:'id',mapping:'id'},
			{name:'name',mapping:'name'},
			{name:'valueKey',mapping:'valueKey'},
			{name:'classType',mapping:'classType'},
			{name:'passingType',mapping:'passingType'}
		]
	});

	store.load({params:{
		fullKey:'<%=fullKey%>',
		id:'<%=id%>'
	}});
	var resultWidth = Ext.getBody().getWidth();
	var cm = new Ext.grid.ColumnModel([
		new Ext.grid.RowNumberer(),
		{header:'ID',dataIndex:'id',width:resultWidth*.15},
		{header:'名称',dataIndex:'name',width:resultWidth*.15},
		{header:'表达式',dataIndex:'valueKey',width:resultWidth*.15},
		{header:'参数类型',dataIndex:'classType',width:resultWidth*.15},
		{header:'输入输出',dataIndex:'passingType',width:resultWidth*.15},
		{header:'操作',dataIndex:'',renderer:function(value, p, record){
			return String.format("<a href=\"javascript:getValidates('<%=fullKey%>','<%=id%>','{0}')\">验证</a>",record.data.id)
		}}
	]);
	
	var grid = new Ext.grid.GridPanel({
		el:'paramInfoDiv',
		stripeRows: true,
	    collapsible:true,
	    trackMouseOver:false, 
	    bodyStyle:'width:100%',
	    loadMask: {msg:'正在加载数据，请稍侯……'}, 
	    autoHeight:true,
		store:store,
		cm:cm
	});
	grid.render();
});
</script>
<script type="text/javascript">
    function getValidates(fullKey,nodeId,paramId) {
        location = "<%=request.getContextPath()%>/edu.ccut.saturn.manager.bundles.impl::/componentModule/action/GetParamValidateInfoAction.action?nodeId="+nodeId+"&fullKey="+fullKey+"&paramId="+paramId;
    }
</script>
</html>